<%@ page import="cn.itheima.bean.Student" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: 储依明
  Date: 2020/7/21
  Time: 19:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>EL表达式test1</title>
</head>
<body>
<%--向域对象添加数据--%>
<% request.setAttribute("username", "zhangsan");%>
<%--获取基本类型String--%>
${username}<br>
<%
    Student stu = new Student("张三", 23);
    pageContext.setAttribute("stu", stu);
%>
<%--获取自定义对象--%>
${stu.name}<br>
${stu.age}<br>

<%--获取map--%>
<%
    HashMap<String, Student> map = new HashMap<>();
    map.put("hm01", new Student("李四", 28));
    map.put("hm02", new Student("王五", 26));
    pageContext.setAttribute("map", map);
%>
${map}
</body>
</html>
